package org.mathcloud.math.core.generic.signature;

import org.mathcloud.math.core.common.signature.QuantityObjectSignature;
import org.webequa.core.generic.signature.GenericObjectSignature;
import org.webequa.core.generic.signature.GenericQuantityObjectSignature;

public class GenericQuantityObjectSignature extends GenericObjectSignature 
	implements QuantityObjectSignature
{
	private GenericQuantityObjectSignature()
	{
		super();
		setObjectType("QuantityObject");
		isComplex = false;
		dimensionsNumber = 1;
		dimensions = new int[]{1};
		isBoolean = false;
	}
	
	public static QuantityObjectSignature getRealNumberSignature()
	{
		return new GenericQuantityObjectSignature();
	}

	public static QuantityObjectSignature getComplexNumberSignature()
	{
		GenericQuantityObjectSignature out = new GenericQuantityObjectSignature();
		out.setComplex(true);
		return out;
	}

	public static QuantityObjectSignature getRealMatrixSignature()
	{
		GenericQuantityObjectSignature out = new GenericQuantityObjectSignature();
		out.setComplex(false);
		out.dimensionsNumber = 2;
		return out;
	}

	public static QuantityObjectSignature getComplexMatrixSignature()
	{
		GenericQuantityObjectSignature out = new GenericQuantityObjectSignature();
		out.setComplex(true);
		out.dimensionsNumber = 2;
		return out;
	}

	public static QuantityObjectSignature getBooleanValueSignature()
	{
		GenericQuantityObjectSignature out = new GenericQuantityObjectSignature();
		out.setComplex(true);
		return out;		
	}
	
	public boolean isRealNumberSignature()
	{
		if (!isComplex&&(dimensionsNumber==1))
			return true;
		else return false;
	}
	
	public boolean isComplexNumberSignature()
	{
		if (isComplex&&(dimensionsNumber==1))
			return true;
		else return false;
	}
	
	public boolean isRealMatrixSignature()
	{
		if (!isComplex&&(dimensionsNumber==2))
			return true;
		else return false;
	}
	
	public boolean isComplexMatrixSignature()
	{
		if (isComplex&&(dimensionsNumber==2))
			return true;
		else return false;
	}

	@Override
	public boolean isBooleanValueSignature()
	{
		return isBoolean;
	}

	@Override
	public int getDimensionsNumber()
	{
		return dimensionsNumber;
	}

	@Override
	public int[] getDimensions()
	{
		return dimensions;
	}

	@Override
	public boolean isComplex()
	{
		return isComplex;
	}

	@Override
	public boolean isMatrix()
	{
		return (dimensionsNumber==2);
	}

	public boolean isBoolean()
	{
		return isBoolean;
	}

	public void setComplex(boolean in)
	{
		isComplex = in;
	}
	
	public void setDimensionsNumber(int in)
	{
		dimensionsNumber = in;
	}
	
	public void setDimensions(int[] in)
	{
		dimensions = in;
	}

	public void setBoolean(boolean isBoolean)
	{
		this.isBoolean = isBoolean;
	}

	private boolean isComplex;
	private int dimensionsNumber;
	private int[] dimensions;
	private boolean isBoolean;
}
